export default{
  data () {
    return {
      activeTab: '',
      pageTabList: []
    }
  },
  watch: {
    activeTab (newVal) {
      let query = this.$router.history.current.query
      let path = this.$router.history.current.path
      let newQuery = JSON.parse(JSON.stringify(query))
      newQuery.tab = newVal
      this.$router.replace({ path, query: newQuery })
    }
  },
  created () {
    if (this.$route.query && this.$route.query.tab && this.pageTabList.includes(this.$route.query.tab)) {
      this.activeTab = this.$route.query.tab
    }
  }
}
